package com.event.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;

@Getter
@AllArgsConstructor
public enum UpdateTypeEnum {

    INSERT("insert","新增"),
    UPDATE("update","更新"),
    DELETE("delete","删除");

    private String type;

    private String desc;

    private static Map<String,UpdateTypeEnum> updateTypeMap = new HashMap<>();

    static {
        for (UpdateTypeEnum updateTypeEnum : UpdateTypeEnum.values()) {
            updateTypeMap.put(updateTypeEnum.getType(),updateTypeEnum);
        }
    }

    public static UpdateTypeEnum get(String type) {
        return updateTypeMap.get(type);
    }
}
